import cn.cvs.config.SpringConfig;
import cn.cvs.pojo.Powerbattery;
import cn.cvs.service.PowerService;
import cn.cvs.service.PowerServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class Tests {
    @Test
    public void selectList(){
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        PowerService bean = (PowerService) context.getBean("PowerServiceImpl");
        List<Powerbattery> list = bean.list();
        list.forEach(lists ->{
            System.out.println(lists.getCarName());
        });

    }
}
